package com.twu.biblioteca.menuoptions;

import com.twu.biblioteca.LibraryItem;
import com.twu.biblioteca.UserManager;

/**
 * Created by olga on 8/06/14.
 */
public class UserDetailsHandler
{
    private UserManager userManager;

    public UserDetailsHandler()
    {
        this.userManager = new UserManager();
    }

    public void setUserManager(UserManager userManager)
    {
        this.userManager = userManager;
    }

    public boolean loginUser()
    {
        return userManager.loginUser();
    }

    public void printUserDetails()
    {
        userManager.printCurrentUserDetails();
    }

    public boolean isUserLoggedIn()
    {
        return userManager.getCurrentUser() != null;
    }

    public void setCurrentUserAsCheckOutUser(LibraryItem item)
    {
        item.setUserCheckedOut(userManager.getCurrentUser());
    }
}
